package me.youline.dataServer.controller.dto;

import java.io.Serializable;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;

/**
 * 用户认证提交服务端的数据
 * @author linhan
 *
 */
public class UserAuthenticationPostDTO implements Serializable {

	private static final long serialVersionUID = -7323301583340724946L;
	
	@Pattern(regexp="1[34578]\\d{9}$")
	@NotBlank
	private String userName;
	
	@Size(max=20,min=6)
	@NotBlank
	private String password;
	
	private String verifyPassword;
	
	@NotBlank
	private String code;
	
	private String zone;
	
	private String socialId;
	
	@Max(2)
	@NotNull
	private Integer connectType = -1;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getZone() {
		return zone;
	}

	public void setZone(String zone) {
		this.zone = zone;
	}

	public String getVerifyPassword() {
		return verifyPassword;
	}

	public void setVerifyPassword(String verifyPassword) {
		this.verifyPassword = verifyPassword;
	}

	public String getSocialId() {
		return socialId;
	}

	public void setSocialId(String socialId) {
		this.socialId = socialId;
	}

	public Integer getConnectType() {
		return connectType;
	}

	public void setConnectType(Integer connectType) {
		this.connectType = connectType;
	}
	
	/**
	 * 判断是否为自由平台注册请求
	 * 
	 * @return
	 */
	public boolean isSelfPlatformRegisterType(){
		if(this.connectType != null && this.connectType >= 0){
			return false;
		}
		return true;
	}

}
